//
//  HttpsTool.h
//  ShakeMountain
//
//  Created by KyのMacPro  on 19/1/5.
//  Copyright © 2019年 KyのMacPro. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^successResposeBlock)(id response);
typedef void(^failureResponseBlock)(NSError * error);
@interface HttpsTool : NSObject
+ (void)get:(NSString *)url params:(NSDictionary *)params success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;

+ (void)post:(NSString *)url params:(NSDictionary *)params success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;

+(void)DELETE:(NSString *)url params:(NSDictionary *)params success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;

+(void)PUT:(NSString *)url params:(NSDictionary *)params success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;

+(void)uploadAvatarImgWithUrl:(NSString *)url WithImg:(UIImage *)avatarImg fileName:(NSString *)fileName success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;
//
//+(void)uploadToQiniuWithImageArray:(NSArray *)array success:(successResposeBlock)successHandler failure:(failureResponseBlock)failureHandler;
/** 下载文件  默认:存储到沙盒 */
+(void)downloadFileWithUrl:(NSString *)url progress:(void (^)(NSProgress * downloadProgress))progress finishedBlock:(void (^)(NSURL * filePath, NSError * error))finished;

/**
 *  下载文件
 *
 *  @param path     url路径
 *  @param success  下载成功
 *  @param failure  下载失败
 *  @param progress 下载进度
 */

@end
